-- requires -XTypeFamilies -XFlexibleInstances -XUndecidableInstances

class Vectorable a where 
	type Vector a
	vectorize :: a -> Vector a

-- OK, but limits us to Ints
instance Vectorable Int where 
	type Vector Int = [Int]
	vectorize = (:[])	

{-
-- this is a little more general, but causes line 21 to fail?!?!
-- error is that id will return [a], but it's looking for Vector [a]...
instance Num a => Vectorable a where 
	type Vector a = [a]
	vectorize = (:[])	
-}

instance Vectorable [a] where 
	type Vector [a] = [a]
	vectorize = id
	
-- good behavior:
-- vectorize (3::Int) = [3]
-- vectorize [1..3]   = [1,2,3]
